import java.util.Scanner;
public class Test7 {
    public static void main(String[] args){
        Scanner scanner=new Scanner(System.in);
         while (scanner.hasNextInt()) {
        int m=scanner.nextInt();
        int n=scanner.nextInt();
        int min=Math.min(m,n);
        int s;
        for(int i=min;i>=1;i--){
            if(m%i==0&&n%i==0){
                min=i;
                break;
            }
        }
        s=(m*n)/min;
            System.out.println(min+" "+s);}
    }
}